Material flow analysis